# -*- coding: utf-8 -*- 

from config import config
from hashlib import sha1
token = config['wechat']['token']

def chk_apptoken(signature, timestamp, nonce):
    p = [timestamp, nonce, token]
    sign = sha1(''.join(sorted(p))).hexdigest()
    if sign == signature:
        return True
    else:
        return False

def post_message(xmlbody):
    pass